from tortoise import fields, models
class SimulationResultTotal(models.Model):
    simulation_result_total_id = fields.IntField(pk=True)
    env_param = fields.ForeignKeyField('models.EnvParameter', related_name='totals')
    battery_energy = fields.DecimalField(max_digits=20, decimal_places=4)
    solar_power = fields.DecimalField(max_digits=20, decimal_places=4)
    grid_power = fields.DecimalField(max_digits=20, decimal_places=4)
    wind_power = fields.DecimalField(max_digits=20, decimal_places=4)
    total_power = fields.DecimalField(max_digits=20, decimal_places=4)
    solar_cost = fields.DecimalField(max_digits=20, decimal_places=4)
    wind_cost = fields.DecimalField(max_digits=20, decimal_places=4)
    grid_cost = fields.DecimalField(max_digits=20, decimal_places=4)
    solar_emission = fields.DecimalField(max_digits=20, decimal_places=4)
    wind_emission = fields.DecimalField(max_digits=20, decimal_places=4)
    grid_emission = fields.DecimalField(max_digits=20, decimal_places=4)
    period_unit = fields.CharField(max_length=20)
    period = fields.IntField()
    name = fields.CharField(max_length=255)
    strategy = fields.CharField(max_length=255)
    simulation = fields.ForeignKeyField(
        'models.Simulation', related_name='results', on_delete=fields.CASCADE
    )
    result_maps: fields.ReverseRelation["SimulationResultTotalMap"]

    class Meta:
        table = "simulation_result_total"